<table summary="" id="pagehead" cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr>
		<td><h1>退货管理</h1></td>
		<td class="actions">
			<table summary="" cellpadding="0" cellspacing="0" border="0" align="right">
				<tr>
					<td <?=$this->view_act ?>><a href="#">待结算退货单列表</a></td>
					<td <?=$this->post_act ?>><a href="#">确认结算</a></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<?php if($this->opt=='view'): ?>
<div class="edit_tab tab">
<div class="bg1">
<div class="bg2">
      <span rel="info" class="span_now">退货单列表</span>
</div>
</div>
</div>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="table1">
       <tr>
            <th class="th0">编号</th>
            <th class="th1">订单编号</th>
            <th class="th1">客户名称</th>
            <th class="th1">状态</th>
            <th class="th1">处理人</th>
            <th class="th1">创建时间</th>
            <th class="th0">操作</a>
       </tr>
       <?php foreach((array)$this->tuihuo_list as $tuihuo): ?> 
       <tr>
            <td><?=$tuihuo['tid']; ?></td>
            <td><?=$tuihuo['order_id']; ?></td>
            <td><?=$tuihuo['customer_name']; ?></td>
            <td><?=$tuihuo['audit_state']; ?></td>
            <td><?=$tuihuo['username']; ?></td>
            <td><?=date('Y-m-d',$tuihuo['created_time']); ?></td>
            <td><?=opt('view','?app=tuihuo&mod=caiwuinfo&tid='.$tuihuo['tid']); ?></td>
       </tr>
       <?php endforeach; ?>
</table>
<div class="page_num">
     <div class="fr">
        <p class="cpager">
            <?php echo $this->pager; ?>
        </p>
     </div>
</div>
<?php elseif($this->opt=='post'): ?>
<script>
$(function(){
    // 提交退货单
    $('#list').submit(function(){
        $.post(location.href,$(this).serialize(),function(data){
			alert(data.message);
			if (data.state == 0)
			{
				window.location='?app=tuihuo&mod=list';
			}
		},'json');
		return false;
    });
});
</script>
<div class="t_2">
     <div class="fl">退货单基本信息</div>
     <div class="fr order_title">--</div>
</div>
<div class="order_show">
     <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td width="20%" class="td1">退货单号：</td>
                <td width="30%"><?=$this->tuihuo['tid']?></td>
                <td width="20%" class="td1">退货单状态：</td>
                <td width="30%"><?=$this->tuihuo['audit_state']?></td>
            </tr>
            <tr>
                <td class="td1">客户：</td>
                <td><?=$this->tuihuo['customer_name']?></td>
                <td class="td1">退货时间：</td>
                <td><?= date('Y-m-d H:i:s',$this->tuihuo['created_time'])?></td>
            </tr>
            <tr>
                <td class="td1">银行：</td>
                <td><?=$this->tuihuo['bank_name']?></td>
                <td class="td1">账户：</td>
                <td><?=$this->tuihuo['bank_no']?></td>
            </tr>
            <tr>
                <td class="td1">处理人：</td>
                <td><?=$this->tuihuo['username']?></td>
                <td class="td1">退款总额：</td>
                <td>￥<?=$this->tuihuo['pprice']?></td>
            </tr>
     </table>
</div>
<div class="line_1"></div>

<div class="t_2">
     <div class="fl">退款单详情</div>
     <div class="fr order_title">--</div>
</div>

<form id="list">
<div class="order_show">
     <table width="100%" cellpadding="0" cellspacing="0" border="0" class="table1">
            <tr>
                <th>商品名称[品牌]</th>
                <th width="100">货号</th>
                <th width="70">退货数量</th>
                <th width="70">退货单价</th>
				<th width="70">小计</div>
            </tr>
			<?php foreach((array)$this->tuikuan_product_list as $product): ?>
            <tr>
                <td class="td2"><?=$product['product_name']?></td>
                <td class="td2"><?=$product['code']?></td>
                <td><?=$product['product_num']?></td>
                <td><?=$product['price']?></td>
				<td><?=$product['product_num']*$product['price']; ?></td>
             </tr>
			<?php endforeach; ?>
            <tr>
                <td colspan="6" class="td1">总计：￥<?=$this->tuihuo['pprice']?></td>
            </tr>
     </table>
</div>
    <div class="t_2">
         <div class="fl">操作信息</div>
         <div class="fr order_title">--</div>
    </div>
    <div class="order_show">
        <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td colspan="2" style="text-align:center;">
                	<input name="" type="submit" class="btn_1" value="确认" />
                	<input type="hidden" name="tid" value="<?=$this->tid;?>" />
                   <input type="button"  value="返回" onClick="javascript:history.back(-1);" />
                </td>
            </tr>
         </table>
    </div>
</form>
<?php endif; ?>